<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/empty_page.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:52 GMT -->
<head>

    <meta charset="utf-8">
    <meta cname="viewport" content="width=device-width, initial-scale=1.0">


    <title>篮球社团管理 - 首页</title>
    <meta name="keywords" content="篮球,社团,管理系统,社">
    <meta name="description" content="高校篮球社团管理系统，计算机等相关的技术，将各社员与学校管理联系起来实现即时信息通讯，为老师学生节约了大量的时间与精力，并大大提高了学校管理工作的效率与质量，同时精简了学校的管理机构。">

    <link rel="shortcut icon" href="/static/favicon.ico"> <link href="/static/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/static/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <link href="/static/css/animate.min.css" rel="stylesheet">
    <link href="/static/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <style type="text/css">
        .news{
            background: white;
            padding: 20px;
            border: solid #f3f3f4;
        }
        .newslist li{
            margin: 6px 0;
        }
        .newslist li a{
            color: #666666;
        }
    </style>
</head>

<body class="gray-bg">

<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-md-8">
            <div class="row">
                <div class="col-md-6 news">
                    <div style="display: flex;justify-content: space-between;">
                        <b style="font-size: 24px">社团新闻|<span>Media Voice</span></b>
                        <div>更多内容>></div>
                    </div>
                    <hr>
                    <ul class="unstyled newslist">
                        <#list newsList as news>
                            <li><a href="/article?nid=#{news.nid}">${news.title}</a></li>
                        </#list>
                    </ul>
                </div>
                <div class="col-md-6 news">
                    <div style="display: flex;justify-content: space-between;">
                        <b style="font-size: 24px">最近活动|<span>Activity</span></b>
                        <div><a href=""></a></div>
                    </div>
                    <hr>
                    <ul class="unstyled newslist">
                        <#list activityList as activity>
                            <#if activity.join>
                                <li><a href="/activityInfo?aid=#{activity.aid}">${activity.aname}</a>(${activity.member_count}人)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="sign" url="/exitActivity?aid=${activity.aid}" href="javascript:;">取消报名</a></li>
                            <#else >
                                <li><a href="/activityInfo?aid=#{activity.aid}">${activity.aname}</a>(${activity.member_count}人)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="sign" url="/joinActivity?aid=${activity.aid}" href="javascript:;">报名</a></li>
                            </#if>
                        </#list>
                    </ul>
                </div>
            </div>
            <div class="row">
<#--                <div class="col-md-12 news">-->
<#--                    <div style="display: flex;justify-content: space-between;">-->
<#--                        <b style="font-size: 24px">我参与的|<span>Activity</span></b>-->
<#--                        <div><a href=""></a></div>-->
<#--                    </div>-->
<#--                    <hr>-->
<#--                    <div class="row">-->
<#--                        <div class="col-md-6">-->
<#--                            活动名称：<input name="aname"/><button id="searchActivity">查询</button><br><br>-->
<#--                            时间范围<br>-->
<#--                            最早开始：<input name="earliest" placeholder="例：2020-03-05 12:00"/><br>-->
<#--                            最晚开始：<input name="latest" placeholder="例：2020-03-05 12:00"/>-->
<#--                            <button id="searchActivity2">查询</button>-->
<#--                        </div>-->
<#--                        <div class="col-md-6">-->
<#--                            <ul id="myActivity" class="unstyled newslist">-->
<#--                                <#list myActivityList as activity>-->
<#--                                    <li><a href="/activityInfo?aid=#{activity.aid}">${activity.aname}</a>(${activity.member_count}人)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="sign" url="/exitActivity?aid=${activity.aid}" href="javascript:;">取消报名</a></li>-->
<#--                                </#list>-->
<#--                            </ul>-->
<#--                        </div>-->
<#--                    </div>-->
<#--                </div>-->
            </div>
        </div>
        <div class="col-md-4 news">
            <div style="display: flex;justify-content: space-between;">
                <b style="font-size: 24px">社团留言|<span>Message</span></b>
                <div>更多内容>></div>
            </div>
            <textarea style="width:100%;height: 100px;" name="leaveMsg"></textarea><br>
            <button onclick="leaveMsg()">留言</button>
            <hr>
            <ul class="unstyled newslist">
                <#list leaveMsgList as leaveMsg>
                    <li>${leaveMsg.writter.uname}：${leaveMsg.message}</a></li>
                </#list>
            </ul>
        </div>
    </div>
</div>
<script src="/static/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/js/bootstrap.min.js?v=3.3.6"></script>
<script>
    function leaveMsg() {
        console.log($("textarea[name='leaveMsg']").val())
        $.ajax({
            url:'/addLeaveMsg',
            data:{
                message:$("textarea[name='leaveMsg']").val()
            },
            success:function(data){
                location.reload()
            }
        })
    }

    $("#searchActivity").click(function(e){
        let url = '/selectActivityByUser?uid=${(Session["user"].uid)!"0"}&aname=' + $("input[name='aname']").val()
        console.log(url)
        $.ajax({
            url:url,
            success:function(res){
                $('#myActivity').html('')
                for(var i = 0;i < res.length;i++){
                    var li = '<li><a href="/activityInfo?aid=' + res[i].aid + '">' + res[i].aname + '</a>&nbsp;&nbsp;' + res[i].time + '&nbsp;&nbsp;&nbsp;<a class="sign" url="/exitActivity?aid=' + res[i].aid + '" href="javascript:;">取消报名</a></li>'
                    $('#myActivity').append(li)
                }
            },
            fail:function(res){
                alert("失败！")
                location.reload()
            }
        })
    })
    $("#searchActivity2").click(function(e){
        var earliest = $("input[name='earliest']").val() || '1998-01-01 00:00'
        var latest = $("input[name='latest']").val() || '2050-01-01 00:00'
        let url = '/selectActivityByDate?uid=${(Session["user"].uid)!"0"}&earliest=' + earliest + '&latest=' + latest
        console.log(url)
        $.ajax({
            url:url,
            success:function(res){
                $('#myActivity').html('')
                for(var i = 0;i < res.length;i++){
                    var li = '<li><a href="/activityInfo?aid=' + res[i].aid + '">' + res[i].aname + '</a>&nbsp;&nbsp;' + res[i].time + '&nbsp;&nbsp;&nbsp;<a class="sign" url="/exitActivity?aid=' + res[i].aid + '" href="javascript:;">取消报名</a></li>'
                    $('#myActivity').append(li)
                }
            },
            fail:function(res){
                alert("失败！")
                location.reload()
            }
        })
    })
    $(".sign").click(function(e){
        console.log($(this).attr("url"))
        let url = $(this).attr("url")
        $.ajax({
            url:url,
            success:function(res){
                alert(res.msg)
                location.reload()
            },
            fail:function(res){
                alert("失败！")
                location.reload()
            }
        })
    })
</script>
<#--<script src="/static/js/content.min.js?v=1.0.0"></script>-->
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
</body>
<!-- Mirrored from www.zi-han.net/theme/hplus/empty_page.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:19:52 GMT -->
</html>
